package com.wbcs.config.template.tags;

import com.wbcs.system.ReportRequest;
import com.wbcs.system.assistant.TagAssistant;
import com.wbcs.system.component.AbsComponentType;
import com.wbcs.system.component.application.report.abstractreport.AbsReportType;
import com.wbcs.util.Consts_Private;

public class STitleTag extends AbsTagInTemplate
{
    public STitleTag(AbsTagInTemplate parentTag)
    {
        super(parentTag);
    }

    @Override
	public String getTagname()
    {
        return Consts_Private.TAGNAME_TITLE;
    }

    @Override
	public String getDisplayValue(ReportRequest rrequest,AbsComponentType ownerComponentObj)
    {
        AbsComponentType displayComponentObj=this.getDisplayComponentObj(rrequest);
        if(displayComponentObj==null) displayComponentObj=ownerComponentObj;
        String type=null;
        String top=null;
        if(this.mTagAttributes!=null)
        {
            type=this.mTagAttributes.get("type");
            top=this.mTagAttributes.get("top");
            type=type==null?"":type.toLowerCase().trim();
        }
        return TagAssistant.getInstance().getTitleDisplayValue((AbsReportType)displayComponentObj,type,top);
    }

}

